package edu.cuit.avatar.exception;

/**
 * @author <a href="mailto:1020zhaodan@163.com">Adan</a>
 * @version 1.0
 * @date 2025/7/11 13:55
 */
public class Circle {
    private float radius;
    private static int numberOfObjects;

    public Circle(float radius) throws IllegalRadiusException{
        setRadius(radius);
        numberOfObjects++;
    }

    public float getRadius() {
        return radius;
    }

    public void setRadius(float radius) throws IllegalRadiusException{
        if(radius < 0)
            throw new IllegalRadiusException(radius);
        this.radius = radius;
    }

    public static int getNumberOfObjects() {
        return numberOfObjects;
    }
}
